<template>
  <view class="uni-flex uni-row">
    <view class="flex-item-avatar">
      <img :src="xitem.user.avatar" />
    </view>
    <view class="flex-item-content">
      <view class="uni-flex uni-row line-header">
        <view class="username">{{xitem.user.nick_name}}</view>
        <view class="user-zan" @click="commentLike()" >
          <uni-icons  type="hand-up" size="18" :color="xitem.is_like==1?'#007aff':'#999'"></uni-icons>
          <text :style="xitem.is_like==1?focusColor:normalColor">{{xitem.like_num}}</text>
        </view>
      </view>
      <view v-if="xitem.to_content" class="container-toContent">
        <text>@{{xitem.toUser.nick_name}}：{{xitem.to_content}}</text>
      </view>
      <view class="container-text">
        <text>{{xitem.content}}</text>
      </view>
      <view class="uni-flex uni-row reply_line">
        <text class="container-return" @click="showCommentWrap(comment_id,xitem.id)" >回复> </text>
        <text>{{xitem.create_at}}</text>
      </view>
    </view>
  </view>
</template>
<script>
import x from '@/common/base.js';
export default {
  name: "reply",
  data() {
    return {
      xitem:{},
      comment_id:0,
      normalColor:"color:#999",
      focusColor:'color:#007aff'
    }
  },
  mounted: function () {
    this.xitem = this.item;
    this.comment_id = this.detail_id
  },
  methods: {
    actionsClick(event){
      if(event === 'like'){
        x.wallLike(this,this.item.id,1);
      }
    },
    commentLike(){
      x.wallLike(this,this.xitem.id,3);
    },
    showCommentWrap(comment_id,reply_id){
      // x.showCommentWrap(this,comment_id,reply_id);
      this.$emit("showComment",{comment_id,reply_id})
    },
  },
  props: ["item","detail_id"],
};
</script>
<style lang="scss">
</style>
